<!--<div class="page-header">-->
<!--<h1>-->
<!--新增计算任务-->
<!--<small>-->
<!--<i class="icon-double-angle-right"></i>-->
<!--<i class="icon-double-angle-right"></i>-->
<!--<i class="icon-double-angle-right"></i>-->
<!--导入计算脚本-->
<!--</small>-->
<!--</h1>-->
<!--</div>&lt;!&ndash; /.page-header &ndash;&gt;-->

<form class="form-vertical">
    <div class="col-xs-12  col-sm-12">
        <h4 class="header smaller lighter blue">
            <span> <strong>导入脚本</strong></span>
        </h4>
    </div>
    <div class="alert {{alertType}} col-xs-12" ng-show="showImportMsg">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>
        <strong>{{importMsg}}</strong>
    </div>
    <div class="col-xs-12">
        <div class="form-group col-xs-12">
            <label class="col-sm-1 control-label padding0 text-right">开发者</label>

            <div class="col-xs-12  col-sm-3">
                <select ng-model="developer" ng-change="change()"
                        id="form-field-select-1" class="width-80"
                        ng-options="dev as dev.cnName for dev in developerOptions">

                </select>
            </div>

            <!--<div class="space-4"></div>-->


            <label class="col-sm-1 control-label padding0 textRight">dol脚本</label>

            <div class="col-xs-12  col-sm-3">
                <input ng-model="dolPath" data-rel="tooltip" type="text" id="form-field-6"
                       placeholder="dol相对fanli_dw文件路径，/xx/xxx.dol"
                       title="balabala" data-placement="bottom" class="width-80"/>
            </div>

            <!--<div class="space-4"></div>-->


            <label class="col-sm-1 control-label padding0 textRight">目标库名</label>

            <div class="col-xs-12  col-sm-3">
                <select ng-model="db"
                        id="form-field-select-2" class="width-80"
                        ng-options="database as database.name for database in hiveDatabases">

                </select>
            </div>
        </div>

    </div>

    <div class="space-4"></div>

    <div class="col-md-offset-5 col-md-12">
        <button ng-click="postDolInfo()" class="btn btn-info" type="button" ng-disabled="showConfig">
            <i class="icon-ok bigger-110"></i>
            提交
        </button>
    </div>

    <div class="col-xs-12 text-center" ng-show="isLoading">
        <div class="loading" style="color: #000000;width: auto">{{loadingMsg}}</div>
    </div>


</form>

<form class="form-vertical" name="scheduleConfigForm" ng-show="showConfig" ng-init="showConfig=false" novalidate>
    <div class="col-xs-12  col-sm-12">
        <h4 class="header smaller lighter blue">
            <span>
                <strong>调度配置信息</strong>
            </span>
        </h4>
    </div>
    <div class="col-xs-12  col-sm-1"></div>
    <div class="col-xs-12">
        <div class="col-xs-12 form-group">

            <label class="col-sm-1 control-label padding0 textRight">任务名称</label>

            <div class="col-sm-3">
                <input type="text" class="width-80" ng-model="conf_taskName"
                       ng-change="checkTaskName()" ng-trim="true">
            </div>

            <label class="col-sm-1 control-label textRight">开发者</label>

            <div class="col-sm-3">
                <span class="block input-icon input-icon-right">
					<input type="text" placeholder="不限" ng-disabled="true"
                           class="width-80" ng-model="conf_developer">

			    </span>
            </div>

            <label class="col-sm-1 control-label padding0 textRight">执行频率</label>

            <div class="col-sm-3">
                <input type="text" class="width-80" name="freq" ng-model="conf_frequency">
                <button class="help-button" tooltip-placement="top" tooltip="具体写法请点击" ng-click="frequencyHelp()">?
                </button>
            </div>
        </div>


        <div class="col-xs-12 form-group">
            <label class="col-sm-1 control-label padding0 textRight">任务组</label>

            <div class="col-sm-3">
                <select name="taskGroup" class="width-80" ng-model="conf_taskGroup" ng-change="setDefaultFreq()"
                        ng-options="group.ID as group.Text for group in taskGroupOptions">
                </select>
            </div>

            <label class="col-sm-1 control-label padding0 textRight">周期</label>

            <div class="col-sm-3">
                <select name="taskCycle" class="width-80" ng-model="conf_cycle" ng-change="cycleChanged()"
                        ng-options="k as v for (k,v) in cycleOptions">
                </select>
            </div>


            <label class="col-sm-1 control-label padding0 textRight">优先级</label>

            <div class="col-sm-3">
                <select name="taskPriority" class="width-80" ng-model="conf_priority"
                        ng-options="priority.ID as priority.Text for priority in priorityOptions">
                </select>
            </div>
        </div>

        <div class="col-xs-12 form-group">
            <label class="col-sm-1 control-label padding0 textRight">失败重跑</label>

            <div class="col-sm-3">
                <select name="recall" class="width-80" ng-model="conf_ifRecall"
                        ng-options="ifRecall.ID as ifRecall.Text for ifRecall in ifRecallOptions"></select>
                </select>
            </div>

            <label class="col-sm-1 control-label padding0 textRight">重跑次数上限</label>

            <div class="col-sm-3">
                <select name="recallLimit" class="width-80" ng-model="conf_recallLimit"
                        ng-options="recallLimit for recallLimit in recallLimitOptions">
                </select>
            </div>

            <label class="col-sm-1 control-label padding0 textRight">失败重跑间隔</label>

            <div class="col-sm-3">
                <select name="recallInterval" class="width-80" ng-model="conf_recallInterval"
                        ng-options="recallInterval.ID as recallInterval.Text for recallInterval in recallIntervalOptions"></select>
                </select>
            </div>
        </div>

        <div class="col-xs-12 form-group">

            <label class="col-sm-1 control-label padding0 textRight">成功返回值</label>

            <div class="col-sm-3">
                <input type="text" class="width-80" ng-model="conf_successCode" ng-trim="true">
                <strong>*</strong>
            </div>

            <label class="col-sm-1 control-label padding0 textRight">等待返回码</label>

            <div class="col-sm-3">
                <input type="text" class="width-80" ng-model="conf_waitCode" ng-trim="true">
            </div>

            <label class="col-sm-1 control-label padding0 textRight">偏移量</label>

            <div class="col-sm-3">
                <select class="width-80" name="taskPeriod" ng-model="conf_offset"
                        ng-options="offset for offset in offsetOptions">
                </select>
                <span class="help-button" tooltip-placement="top"
                      tooltip="D：天级偏移，M：月级偏移，字母后的数字表示具体的偏移值，D0：不偏移，D1：向前偏移一天，M2：向前偏移两月">?</span>
            </div>

        </div>

        <div class="col-xs-12 form-group">

            <label class="col-sm-1 control-label padding0 textRight"
                    >超时时间</label>

            <div class="col-sm-3">
                <select class="width-80" name="taskTimeout" ng-model="conf_timeout"
                        ng-options="timeout.ID as timeout.Text for timeout in timeoutOptions" required>
                </select>
                <span class="help-button" tooltip-placement="top"
                      tooltip="当任务执行时间超过指定时间后，调度置其状态为timeout">?</span>
            </div>

            <!--<label class="col-sm-1 control-label padding0 textRight">执行命令</label>-->

            <!--<div class="col-sm-7">-->
            <!--<input type="text" class="width-95" ng-model="conf_para1" ng-trim="true">-->
            <!--<strong>*</strong>-->
            <!--&lt;!&ndash;<textarea type="text" rows=5 class="width-90" name="freq" ng-model="command">&ndash;&gt;-->
            <!--&lt;!&ndash;</textarea>&ndash;&gt;-->
            <!--</div>-->
        </div>
    </div>
    <div class="alert alert-danger col-xs-12" ng-show="showCfgMsg">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>
        <strong>{{cfgMsg}}</strong>
    </div>
    <div class="alert alert-success col-xs-12" ng-show="showSaveSucess">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>
        <strong>{{saveSuccessMsg}}</strong>
    </div>
    <div class="col-xs-12 text-center" ng-show="cfgSaveIsLoading">
        <div class="loading" style="color: #000000;width: auto">{{cfgSaveLoadingMsg}}</div>
    </div>

    <div class="col-xs-12  col-sm-12">
        <h4 class="header smaller lighter blue">
                                        <span> <strong>调度依赖信息</strong>
                                        </span>
        </h4>
    </div>
    <div class="col-xs-12  col-sm-1"></div>

    <div class="col-xs-12" style="padding-bottom: 20px">
        <div class="col-xs-12 width-100">
            <div class="table-header">前驱依赖</div>
            <div class="table-responsive">
                <div class="dataTables_wrapper" role="grid">
                    <table class="table table-striped table-bordered table-hover dataTable">
                        <thead>
                        <tr role="row">
                            <th>任务ID</th>
                            <th>任务名称</th>
                            <th>任务周期</th>
                            <th>偏移量</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="dependenceTask in dependenceTasks">
                            <td>{{dependenceTask.taskId}}</td>
                            <td>{{dependenceTask.taskName}}</td>
                            <!--<td>{{dependenceTask.cycle}}</td>-->
                            <!--<td>{{dependenceTask.cycleGap}}</td>-->
                            <td>
                                <span class="label {{getExecutionCycleLabel(dependenceTask.cycle)}}">
                                    {{getCycleText(dependenceTask.cycle)}}
                                </span>
                            </td>
                            <td>
                                <select class="width-80"  ng-model="dependenceTasks[$index].offset"
                                        ng-options="offset for offset in {{getOffsetOptions(dependenceTask.cycle)}}">
                                </select>
                            </td>
                            <!--<td>-->
                            <!--<span class="label {{getExecutionCycleLabel(dependenceTask.cycle)}}">{{getCycleText(dependenceTask.cycle)}}-->
                            <!--</span>-->
                            <!--</td>-->
                            <!--<td>-->
                            <!--<select class="width-80" name="taskPeriod" ng-model="dependenceTasks[$index].cycleGap"-->
                            <!--ng-options="offset for offset in {{getOffsetOptions(dependenceTask.cycle)}}"></select>-->
                            <!--</select>-->
                            <!--</td>-->
                            <td>
                                <button class="btn-link ng-scope"
                                        ng-click="deleteDependenceTask($index)"
                                        tooltip-placement="top" tooltip="删除依赖">
                                    <i class="icon-remove bigger-150"></i>
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="row" id="addDependencyButton">
                        <button class="btn-link ng-scope" ng-click="showDependenceDialog()"
                                tooltip-placement="top"
                                tooltip="添加依赖">
                            <i class="icon-plus bigger-180"></i>
                        </button>
                    </div>
                    <div class="col-sm-12">
                        <p class="text-right">
                            <button class="btn btn-lg btn-success" ng-click="returnStep1()" ng-disabled="taskConfPre">
                                重新导入
                            </button>
                            <button class="btn btn-lg btn-success" ng-click="submitTaskConfig()"
                                    ng-disabled="taskConfSave">保存
                            </button>
                            <button class="btn btn-lg btn-success" ng-click="gotoStep3()" ng-disabled="taskConfNext">
                                元数据
                            </button>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

<div style="margin-bottom: 40px" ng-show="showMetaConfig">
    <div class="row" style="padding-left: 10px; padding-right: 10px">
        <div class="col-xs-12 text-center" ng-show="metaIsLoading">
            <div class="loading" style="color: #000000;width: auto">{{metaLoadingMsg}}</div>
        </div>


        <form class="form-vertical" ng-show="true" name="scheduleConfigForm" novalidate>
            <div class="col-xs-12  col-sm-12">
                <h4 class="header smaller lighter blue">
                    <span> <strong>表信息</strong></span>
                </h4>
            </div>

            <div class="col-xs-12">
                <div class="col-xs-12 form-group">
                    <label class="col-sm-1 control-label padding0 textRight">表的注释</label>

                    <div class="col-xs-12  col-sm-3">
                        <input type="text" id="inputWarning2" class="width-80"
                               ng-model="tableComment"><strong>*</strong>
                    </div>

                    <label class="col-sm-1 control-label padding0 textRight">表的类型</label>

                    <div class="col-xs-12  col-sm-3">
                        <input type="text" id="inputWarning4" ng-model="tableType"
                               class="width-80"
                               disabled>
                    </div>
                    <label class="col-sm-1 control-label padding0 textRight">刷新周期</label>

                    <div class="col-xs-12  col-sm-3">
                        <select id="inputWarning6" ng-model="refreshType" class="width-80"
                                ng-options="type.ID as type.Text for type in tableRefreshTypes"></select>
                        <strong>*</strong>
                    </div>
                </div>

                <div class="col-xs-12 form-group">
                    <label class="col-sm-1 control-label padding0 textRight">路径</label>

                    <div class="col-xs-12  col-sm-3">
                        <input type="text" id="inputWarning3" ng-model="tableLocation"
                               ng-disabled="tableType=='MANAGED_TABLE'" class="width-80">
                        <strong>*</strong>
                    </div>
                </div>
            </div>


            <div class="col-xs-12  col-sm-12">
                <h4 class="header smaller lighter blue">
                    <span><strong>列信息</strong></span>
                </h4>
            </div>

            <div class="col-xs-12">
                <div class="table-responsive" style="border: lightblue thin solid">
                    <div class="dataTables_wrapper" role="grid">
                        <!--<div class="row" ng-controller="SyncTableToolWatchCtrl">-->
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="dataTables_length">
                                    <label>
                                        每页显示
                                        <select ng-model="showColumnTable.selectedRecordPerPage"
                                                ng-options="rpp for rpp in showColumnTable.recordPerPageOptions"
                                                required
                                                ng-change="showColumnTable.selectedRecordPerPageChanged()">
                                        </select>
                                        条记录
                                    </label>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="dataTables_filter">
                                    <label>
                                        过滤:
                                        <input type="text" ng-model="showColumnTable.query"
                                               ng-change="showColumnTable.queryChanged()">
                                    </label>
                                </div>
                            </div>
                            <table class="table table-striped table-bordered table-hover dataTable"
                                   style="table-layout:fixed;">
                                <thead>
                                <tr role="row">
                                    <th width="10%">序号</th>
                                    <th width="20%">列名</th>
                                    <th width="20%">类型</th>
                                    <th width="50%">注释</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="column in showColumnTable.displayedDataList.slice(showColumnTable.startIndex-1, showColumnTable.endIndex)">
                                    <td width="10%">{{column.index}}</td>
                                    <td width="20%">{{column.name}}</td>
                                    <td width="20%">
                                        <input type="text" ng-model="column.type" class="width-75" disabled>
                                    </td>
                                    <td width="50%">
                                        <input type="text"
                                               ng-model="showColumnTable.displayedDataList.slice(showColumnTable.startIndex-1, showColumnTable.endIndex)[$index].comment"
                                               ng-change="changeComment($index)"
                                               class="width-75">
                                <span class=" light-red " tooltip-placement="top"
                                      tooltip-html-unsafe="注释必填">
                                    <strong>*</strong>
                                </span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="row">
                                <div class="col-sm-5">
                                    <div class="dataTables_info">
                                        展示第{{showColumnTable.startIndex}}条记录至第{{showColumnTable.endIndex}}条记录（总计{{showColumnTable.total}}条记录）
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_bootstrap">
                                        <ul class="pagination" style="display: block">
                                            <li class="{{showColumnTable.getDisableLabelforPrevious()}}">
                                                <a href="" ng-click="showColumnTable.gotoFirstPage()"> <i
                                                        class="icon-double-angle-left"></i>
                                                </a>
                                            </li>
                                            <li class="{{showColumnTable.getDisableLabelforPrevious()}}">
                                                <a href="" ng-click="showColumnTable.previousPage()">
                                                    <i class="icon-angle-left"></i>
                                                </a>
                                            </li>
                                            <li ng-repeat="num in showColumnTable.getCurrentPageNumDisplay()"
                                                class="{{showColumnTable.getActiveLabel(num)}}">
                                                <a href=""
                                                   ng-click="showColumnTable.changePage(num)">{{num}}</a>
                                            </li>
                                            <li class="{{showColumnTable.getDisableLabelforNext()}}">
                                                <a href="" ng-click="showColumnTable.nextPage()">
                                                    <i class="icon-angle-right"></i>
                                                </a>
                                            </li>
                                            <li class="{{showColumnTable.getDisableLabelforNext()}}">
                                                <a href="" ng-click="showColumnTable.gotoLastPage()">
                                                    <i class="icon-double-angle-right"></i>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            <div class="col-xs-12  col-sm-12" ng-show="partitions.length != 0">
                <h4 class="header smaller lighter blue">
                    <span><strong>分区字段信息</strong></span>
                </h4>
            </div>

            <div class="col-xs-12 text-center" ng-show="publishSuccess">
                <div class="loading" style="color: #000000;width: auto">{{publishLoadingMsg}}</div>
            </div>

            <div class="col-xs-12  col-sm-12" ng-show="partitions.length != 0">
                <table class="table table-striped table-bordered table-hover dataTable" style="table-layout:fixed;">
                    <thead>
                    <tr role="row">
                        <th width="10%">序号</th>
                        <th width="20%">列名</th>
                        <th width="20%">类型</th>
                        <th width="50%">注释</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="partition in partitions">
                        <td width="10%">{{partition.index}}</td>
                        <td width="20%">{{partition.name}}</td>
                        <td width="20%">{{partition.type}}</td>
                        <td width="50%">
                            <input type="text" ng-model="partition.comment" class="width-75">
                    <span class=" light-red " tooltip-placement="top"
                          tooltip-html-unsafe="注释必填"><strong>*</strong>
                    </span>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
            <div class="col-sm-12">
                <p class="text-right">
                    <button class="btn btn-lg btn-success" ng-click="returnStep2()" ng-disabled="preThree">上一步</button>
                    <button class="btn btn-lg btn-success" ng-click="saveMeta()" ng-disabled="saveThree">保存</button>
                    <button class="btn btn-lg btn-success" ng-click="publish()" ng-disabled="publishThree">上线</button>
                </p>
            </div>


            <div class="alert {{publishStatusClass}} col-xs-12" ng-show="showPublishResultMsg">
                <button type="button" class="close" data-dismiss="alert">
                    <i class="icon-remove"></i>
                </button>
                <strong>{{publishResultMsg}}</strong>
            </div>


            <!--<div class="row">-->
            <!--<div class="col-sm-11"></div>-->
            <!--<div class="col-sm-1">-->
            <!--<button class="btn btn-primary" ng-click="getSql($index)" ng-show="table.submitShow">提交</button>-->
            <!--</div>-->
            <!--</div>-->
        </form>
    </div>
</div>

